home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: leeds.ac.uk!news
- From: H.Lawson@tees.ac.uk (Hamish Lawson)
- Subject: Cast from function expecting a reference to one expecting a pointer
- Message-ID: <310DF504.69E6@tees.ac.uk>
- X-Mailer: Mozilla 2.0b6a (Win95; I)
- Content-Type: text/plain; charset=us-ascii
- Organization: University of Teesside
- MIME-Version: 1.0
- Date: Tue, 30 Jan 1996 10:37:12 +0000 (GMT)
- Content-Transfer-Encoding: 7bit
-
- Is it legal to cast from a function which expects a reference to one
- expecting a pointer, as in the sample code below.
-
-
- void somefunc(sometype &n);
-
- typedef void (*funcptr)(sometype *);
- ...
- sometype x, *p = &x;
- funcptr f = (funcptr) somefunc;
- f(x);
- f(p);
-
-
- | Hamish Lawson, School of Computing and Mathematics,
- | University of Teesside, Middlesbrough, Cleveland, UK, TS1 3BA
- | Tel: +44 1642 218121 x3611 Fax: +44 1642 342604
- | E-mail: H.Lawson@tees.ac.uk
-